{extend name="layout/edit" /}
{block name="content"}
<!-- form start -->
<form action="{:url('editSave')}" method="post" class="form-horizontal">
    <div class="box-body">
        <div class="form-group">
            <label class="col-sm-2 control-label">软件标题</label>
            <div class="col-sm-10">
                <input type="text" name="title" class="form-control input-sm" placeholder="软件标题" value="{$data.title??''}" required="required" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">软件类别</label>
            <div class="col-sm-4">
                <select name="category_id" class="form-control input-sm" data-url="{:url('softCategory/getTreeJson')}" data-value="{$data.category_id??0}"></select>
            </div>
            <label class="col-sm-2 control-label">环境需求</label>
            <div class="col-sm-4">
                <input type="text" name="env_requirement" class="form-control input-sm" placeholder="环境需求" value="{$data.env_requirement??''}" required="required" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">软件版本</label>
            <div class="col-sm-4">
                <input type="text" name="version" class="form-control input-sm" placeholder="软件版本" value="{$data.version??''}" required="required" />
            </div>
            <label class="col-sm-2 control-label">软件大小</label>
            <div class="col-sm-4">
                <input type="text" name="filesize" class="form-control input-sm" placeholder="软件大小" value="{$data.filesize??''}" required="required" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">预览图片</label>
            <div class="col-sm-10">
                <div class="input-group">
                    <input type="text" name="picture_url" class="form-control input-sm"  placeholder="预览图片" value="{$data.picture_url??''}">
                    <span class="input-group-btn">
                        <a href="{$data.picture_url??''}" class="btn btn-sm btn-default btn-sm" title="打开地址" target="_blank"><i class="fa fa-external-link"></i></a>
                        <a href="{:url('uploader/delete')}" class="btn btn-sm btn-default btn-sm xsui-btn-singlefile-delete-image" title="删除图片">删除</a>
                        <a href="{:url('uploader/single_file','name=picture_url')}" class="btn btn-sm btn-default btn-sm xsui-btn-singlefile-uploader-image" title="选择图片并上传">上传</a>
                    </span>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">下载地址</label>
            <div class="col-sm-10">
                <div class="input-group">
                    <input type="text" name="download_url" class="form-control input-sm"  placeholder="下载地址" value="{$data.download_url??''}">
                    <span class="input-group-btn">
                        <a href="{$data.download_url??''}" class="btn btn-sm btn-default btn-sm" title="打开地址" target="_blank"><i class="fa fa-external-link"></i></a>
                        <a href="{:url('uploader/delete')}" class="btn btn-sm btn-default btn-sm xsui-btn-singlefile-delete-image" title="删除文件">删除</a>
                        <a href="{:url('uploader/single_file','name=download_url&scene=zip')}" class="btn btn-sm btn-default btn-sm xsui-btn-singlefile-uploader-image" title="选择文件并上传">上传</a>
                    </span>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">源码地址</label>                        
            <div class="col-sm-4">
                <div class="input-group">
                    <span class="input-group-addon">URL</span>
                    <input type="text" name="repository_url" class="form-control input-sm" placeholder="源码地址" value="{$data.repository_url??''}" />
                    <span class="input-group-btn">
                        <a href="{$data.repository_url??''}" class="btn btn-sm btn-default btn-sm" title="打开地址" target="_blank"><i class="fa fa-external-link"></i></a>
                    </span>
                </div>
            </div>
            <label class="col-sm-2 control-label">镜像地址</label>                        
            <div class="col-sm-4">
                <div class="input-group">
                    <span class="input-group-addon">URL</span>
                    <input type="text" name="mirror_url" class="form-control input-sm" placeholder="镜像地址" value="{$data.mirror_url??''}" />
                    <span class="input-group-btn">
                        <a href="{$data.mirror_url??''}" class="btn btn-sm btn-default btn-sm" title="打开地址" target="_blank"><i class="fa fa-external-link"></i></a>
                    </span>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">摘要内容</label>
            <div class="col-sm-10">
                <textarea name="summary" class="form-control input-sm" placeholder="摘要内容">{$data.summary??''}</textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">软件内容</label>
            <div class="col-sm-10">
                <textarea name="content" class="form-control input-sm xsui-editor" placeholder="软件内容" data-uploadurl="{:url('uploader/kindeditor_upload')}">{$data.content??''}</textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">内容标签</label>
            <div class="col-sm-4">
                <input type="text" name="content_tags" class="form-control input-sm" placeholder="内容标签,多个标签之间以空格隔开(如:蓝色 红色 黑色 绿色 橙色 粉色 紫色 银色 黑白 炫彩)" value="{$data.content_tags??''}" required="required" />
            </div>
            <label class="col-sm-2 control-label">状态</label>
            <div class="col-sm-4">
                {xshtml:radio name="status" data='array("1"=>"显示","0"=>"隐藏")' value="data['status']|default=1" /}
            </div>
        </div>
    </div>
    <!-- /.box-body -->
    <div class="box-footer">
        <button type="button" class="btn btn-sm btn-default xsui-btn-close-dialog">取消</button>
        <button type="submit" class="btn btn-sm btn-primary pull-right">保存</button>
        <input type="hidden" name="id" value="{$data.id??0}"/>
    </div>
    <!-- /.box-footer -->
</form>
{/block}
{block name="script_after"}
<script>
    $('select[name="category_id"]').ajaxcombobox({first: {id: "", text: "选择类别"}});
</script>
{/block}